package com.company.bookstore.qo.order_module;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.company.bookstore.entities.book_module.Book;
import com.company.bookstore.entities.order_module.Logistics;
import com.company.bookstore.entities.user_admin_module.User;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.*;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Builder
@Data
@NoArgsConstructor
@AllArgsConstructor
@Getter
@Setter
@TableName("t_order")
public class OrderQo {

    private Integer id;
    private String orderNum;
    private Integer status;
    private Double price;
    private Integer num;
    private Double totalPrice;
    private String evaluate;
    private Integer grade;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")//頁面傳入數據到數據庫自動格式化
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date createTime;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")//頁面傳入數據到數據庫自動格式化
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date finishTime;
    private Integer fkUserId;
    private Integer fkBookId;
    private Integer orderAdd;
    private Integer deleted;
    private User user;
    private Book book;
    //冗余字段，用来封装页面
    private Integer current;
    private Integer size;
    @DateTimeFormat(pattern = "yyyy-MM-dd")//頁面傳入數據到數據庫自動格式化
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    private Date from;
    @DateTimeFormat(pattern = "yyyy-MM-dd")//頁面傳入數據到數據庫自動格式化
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    private Date to;

}
